<template>
  <div class="container">
    <el-card shadow="always">
      <el-row :gutter="20">
        <el-col :span="6">
          <el-input
            maxlength="50"
            v-model="query.searchValue"
            clearable
            placeholder="请输入会议主题名称"
          ></el-input>
        </el-col>
        <!-- <el-col :span="4">
          <el-select v-model="value" placeholder="请选择考核结果" clearable>
            <el-option
              v-for="item in options"
              :key="item"
              :label="item"
              :value="item"
            >
            </el-option>
          </el-select>
        </el-col> -->
        <el-col :span="2">
          <el-button
            type="primary"
            @click="
              query.page = 1;
              getList();
            "
            >查询</el-button
          >
        </el-col>
      </el-row>
      <rz-height></rz-height>
      <el-table :data="tableData" border style="width: 100%">
             <el-table-column prop="meetingTimeStr" label="会议日期">
        </el-table-column>
        <el-table-column prop="meetingTheme" label="会议主题">
        </el-table-column>
        <el-table-column prop="hostName" label="会议主持"> </el-table-column>
        <el-table-column prop="" label="操作">
          <template slot-scope="scope">
            <el-button size="mini" type="primary" @click="view(scope.row)"
              >查看</el-button
            >
          </template>
        </el-table-column>
      </el-table>
      <pagination
        :total="total"
        @pagination="getList"
        :page.sync="query.page"
      />
    </el-card>

    <rz-dialog
      :dialogVisible.sync="dialogVisible"
      :isShowConfirm="false"
      title="查看联席会议"
    >
      <el-form label-width="120px">
        <el-row>
          <el-col :span="12">
            <el-form-item label="会议主题">
              {{ data.meetingTheme }}
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="会议时间">
              {{ data.meetingTime }}
            </el-form-item>
          </el-col>
        </el-row>

        <el-row>
          <el-col :span="12">
            <el-form-item label="会议主持"> {{ data.hostName }} </el-form-item>
          </el-col>
           <el-col :span="12">
            <el-form-item label="工作站成员">
              {{ data.foodPerson }}
            </el-form-item>
          </el-col>
      
        </el-row>

        <el-row>
              <el-col :span="12">
            <el-form-item label="监督部门">
              {{ data.supervisionUnitName }}
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="监督人员">
              {{ data.supervisionPerson }}
            </el-form-item>
          </el-col>
         
        </el-row>
        <el-row>
         
          <el-col :span="12">
            <el-form-item label="消费者代表">
              {{ data.consumerPerson }}</el-form-item
            >
          </el-col>
          <!-- <el-col :span="12">
            <el-form-item label="会议内容">
              {{ data.supPerson}}
            </el-form-item>
          </el-col> -->
        </el-row>
        <el-row v-for="item in data.unitList" :key="item.id">
          <el-col :span="12">
            <el-form-item label="单位名称">
              {{ item.supUnitName }}
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="参培人员">
              {{ item.supPerson }}
            </el-form-item>
          </el-col>
        </el-row>
        <el-row>
          <el-col :span="12">
            <el-form-item label="会议内容">
              {{ data.meetingContent }}
            </el-form-item>
          </el-col>
        </el-row>

        <el-row>
          <el-col :span="12">
            <el-form-item label="备注">
              {{ data.remark }}
            </el-form-item>
          </el-col>
        </el-row>
        <el-form-item label="培训照片">
          <el-image
            v-for="(index, item) in data.imgList"
            :key="item"
            style="width: 150px; height: 150px; margin-right: 10px"
            :src="index.fileUrl"
            fit="fill"
            :preview-src-list="data.imgList.map((x) => x.fileUrl)"
          ></el-image>
        </el-form-item>
      </el-form>
    </rz-dialog>
  </div>
</template>
<script>
//
import {
  conferenceFindListByCondition,
  conferenceFindResponseById,
} from "@/api/modules/workstation";
export default {
  // props:[],
  // 页面加载
  created() {
    this.getList();
  },
  // 页面加载完成
  mounted() {},
  //实例销毁之前
  beforeDestroy() {},
  //实例销毁后
  destroyed() {},
  data() {
    return {
      query: {
        complaintCategory: "",
        complaintUnit: "",
        pageIndex: 1,
        pageSize: 10,
        processingResults: "",
        registerData: "",
        registrant: "",
        workStationId: sessionStorage.getItem("workId"),
        workStationName: "亿通测试食安工作站",
      },
      tableData: [],
      total: 0,
      dialogVisible: false,
      data: {},
    };
  },
  // 方法
  methods: {
    getList() {
      conferenceFindListByCondition(this.query).then((res) => {
        // res.data.forEach((x) => {
        //   for (const key in x) {
        //     if (!x[key]) {
        //       x[key] = "--";
        //     }
        //   }
        // });
        this.total = res.totalCount;
        this.tableData = res.data;
      });
    },
    view(e) {
      conferenceFindResponseById({
        params: { id: e.id },
      }).then((res) => {
          for (const key in  res.data) {
            if (!res.data[key]) {
              res.data[key] = "--";
            }
          }
        this.data = res.data;
        this.dialogVisible = true;
      });
    },
  },
};
</script>

<style lang="scss" scoped>
</style>